<template>
  <div>
    儿子组件: {{ value }}
    <button @click="change">改变父组件的值</button>
    <Grandson1 :value="value" @say="say"></Grandson1>
  </div>
</template>

<script>
import Grandson1 from './Grandson1'

export default {
  name: 'Son1',
  props: {
    value: {
      type: Number,
      default: 1
    }
  },
  components: {
    Grandson1
  },
  methods: {
    change () {
      this.$emit('changeMoney', 200)
      // this.$emit('update:value', 200)
      // this.$emit('input', 200)
    },
    say (message) {
      console.log(message)
    }
  }
}
</script>

<style>

</style>